package com.inspur.edp.common.expr.expresses.constant;


import com.inspur.edp.common.expr.Express;
import com.inspur.edp.common.expr.ExpressDSLGenerator;
import com.inspur.edp.common.expr.ast.ASTContext;
import com.inspur.edp.common.expr.util.DSLStringUtils;

/**
 * @author lizhaorui
 * @description TODO
 * @date 2024/12/17 10:24
 */
public class StringConstDSL implements ExpressDSLGenerator {

    @Override
    public String getKind() {
        return StringConstExpr.KIND;
    }

    @Override
    public String generate(ASTContext context, Express express) {
        StringConstExpr stringConstExpr = (StringConstExpr) express;
        return String.format("\"%s\"", DSLStringUtils.handle(stringConstExpr.getValue()));
    }
}
